// source_view.cs created with MonoDevelop
// User: andreas at 22:05 22.05.2009
//
// To change standard headers go to Edit->Preferences->Coding->Standard Headers
//

using System;
using System.Xml;
using System.Xml.XPath;
namespace new_csharptest
{
	public class source_view
	{
		public string[] indexOf_languages = {"plain text", "c" ,"c++","perl","python","Shell"};
		
		public void change_highlighting(int lang_index, Gtk.TextView txt_view)
		{
			
			if(lang_index == 0)
			{
				
			}
			else if (lang_index == 1)
			{
				
			}
			else if(lang_index == 2)
			{
//				string to_cpp = System.Environment.CurrentDirectory + "highlighting/cpp.xml";
//				XPathDocument xml_cpp = new XPathDocument(to_cpp);
//				XPathNavigator xml_cpp_nav = xml_cpp.CreateNavigator();
//				xml_cpp_nav.SelectSingleNode("highlighting");
			}
			else if(lang_index == 3)
			{
				
			}
		}

		public int get_indexof_lang(string lang)
		{
			int i = 0;
			
			for(int i_ = 0 ; i_ != indexOf_languages.Length ; i_++)
			{
				if(indexOf_languages[i_].Contains(lang))
				{
					i = i_;
					return i_;
				}
				else
				{
					i = 0;
					return 0;
				}
			}
			return i;
		}
		
		public string get_string_ofindex(int i)
		{
			if(i > indexOf_languages.Length)
			{
				return "plain text";
			}
			else 
			{
				return indexOf_languages[i];
			}
		}
	}
}
